package models

import (
	"gitee.com/sansaniot/ssiot-core/httpmvc/model"
	"gorm.io/datatypes"

	"ssdevice/common/dto"
)

type SysHistorySensor struct {
	DevSn      string         `json:"devSn"`
	Value      datatypes.JSON `json:"value" gorm:"type:jsonb"`
	UpdateTime dto.LocalTime  `json:"updateTime"`
	DateTime   string         `json:"dateTime"`

	model.Model

	UpdateTimeInsStr string `gorm:"-"`
	DevName          string `json:"devName" gorm:"-"`
}

func (SysHistorySensor) TableName() string {
	return "sys_history_sensor"
}

func (e *SysHistorySensor) Generate() interface{} {
	o := *e
	return &o
}

type SysHistorySensorQuery struct {
	DevSn      string        `json:"devSn"`
	Value      interface{}   `json:"value" gorm:"type:jsonb"`
	UpdateTime dto.LocalTime `json:"updateTime"`
	DevName    string        `json:"devName" gorm:"-"`
}

func (SysHistorySensorQuery) TableName() string {
	return "sys_history_sensor"
}
